{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 载入数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.rcParams['font.sans-serif'] = ['SimHei']\n",
    "plt.rcParams['axes.unicode_minus'] = False\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "target_url = (\"https://archive.ics.uci.edu/ml/machine-\"\n",
    "              \"learning-databases/glass/glass.data\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ID</th>\n",
       "      <th>RI</th>\n",
       "      <th>Na</th>\n",
       "      <th>Mg</th>\n",
       "      <th>Al</th>\n",
       "      <th>Si</th>\n",
       "      <th>K</th>\n",
       "      <th>Ca</th>\n",
       "      <th>Ba</th>\n",
       "      <th>Fe</th>\n",
       "      <th>Type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1.52101</td>\n",
       "      <td>13.64</td>\n",
       "      <td>4.49</td>\n",
       "      <td>1.10</td>\n",
       "      <td>71.78</td>\n",
       "      <td>0.06</td>\n",
       "      <td>8.75</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1.51761</td>\n",
       "      <td>13.89</td>\n",
       "      <td>3.60</td>\n",
       "      <td>1.36</td>\n",
       "      <td>72.73</td>\n",
       "      <td>0.48</td>\n",
       "      <td>7.83</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1.51618</td>\n",
       "      <td>13.53</td>\n",
       "      <td>3.55</td>\n",
       "      <td>1.54</td>\n",
       "      <td>72.99</td>\n",
       "      <td>0.39</td>\n",
       "      <td>7.78</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>1.51766</td>\n",
       "      <td>13.21</td>\n",
       "      <td>3.69</td>\n",
       "      <td>1.29</td>\n",
       "      <td>72.61</td>\n",
       "      <td>0.57</td>\n",
       "      <td>8.22</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>1.51742</td>\n",
       "      <td>13.27</td>\n",
       "      <td>3.62</td>\n",
       "      <td>1.24</td>\n",
       "      <td>73.08</td>\n",
       "      <td>0.55</td>\n",
       "      <td>8.07</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   ID       RI     Na    Mg    Al     Si     K    Ca   Ba   Fe  Type\n",
       "0   1  1.52101  13.64  4.49  1.10  71.78  0.06  8.75  0.0  0.0     1\n",
       "1   2  1.51761  13.89  3.60  1.36  72.73  0.48  7.83  0.0  0.0     1\n",
       "2   3  1.51618  13.53  3.55  1.54  72.99  0.39  7.78  0.0  0.0     1\n",
       "3   4  1.51766  13.21  3.69  1.29  72.61  0.57  8.22  0.0  0.0     1\n",
       "4   5  1.51742  13.27  3.62  1.24  73.08  0.55  8.07  0.0  0.0     1"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "columns_mapping = {\n",
    "    'ID': 'ID',\n",
    "    'RI': '折射率',\n",
    "    'Na': '钠',\n",
    "    'Mg': '镁',\n",
    "    'Al': '铝',\n",
    "    'Si': '硅',\n",
    "    'K': '钾',\n",
    "    'Ca': '钙',\n",
    "    'Ba': '钡',\n",
    "    'Fe': '铁',\n",
    "    'Type': '类型',\n",
    "}\n",
    "\n",
    "try:\n",
    "    df_glass = pd.read_csv(\"../../data/glass.csv\", header=0)\n",
    "except Exception as e:\n",
    "    print(e)\n",
    "    df_glass = pd.read_csv(target_url, header=None, prefix=\"V\")\n",
    "    df_glass.columns = columns_mapping.keys()\n",
    "    df_glass.to_csv(\"../../data/glass.csv\", index=False)\n",
    "\n",
    "df_glass.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of Rows:  214\n",
      "Number of Cols:  11\n"
     ]
    }
   ],
   "source": [
    "nrows, ncols = df_glass.shape\n",
    "print(\"Number of Rows: \", nrows)\n",
    "print(\"Number of Cols: \", ncols)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 绘制玻璃数据的关联热图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>RI</th>\n",
       "      <th>Na</th>\n",
       "      <th>Mg</th>\n",
       "      <th>Al</th>\n",
       "      <th>Si</th>\n",
       "      <th>K</th>\n",
       "      <th>Ca</th>\n",
       "      <th>Ba</th>\n",
       "      <th>Fe</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>RI</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.191885</td>\n",
       "      <td>-0.122274</td>\n",
       "      <td>-0.407326</td>\n",
       "      <td>-0.542052</td>\n",
       "      <td>-0.289833</td>\n",
       "      <td>0.810403</td>\n",
       "      <td>-0.000386</td>\n",
       "      <td>0.143010</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Na</th>\n",
       "      <td>-0.191885</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.273732</td>\n",
       "      <td>0.156794</td>\n",
       "      <td>-0.069809</td>\n",
       "      <td>-0.266087</td>\n",
       "      <td>-0.275442</td>\n",
       "      <td>0.326603</td>\n",
       "      <td>-0.241346</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mg</th>\n",
       "      <td>-0.122274</td>\n",
       "      <td>-0.273732</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.481799</td>\n",
       "      <td>-0.165927</td>\n",
       "      <td>0.005396</td>\n",
       "      <td>-0.443750</td>\n",
       "      <td>-0.492262</td>\n",
       "      <td>0.083060</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Al</th>\n",
       "      <td>-0.407326</td>\n",
       "      <td>0.156794</td>\n",
       "      <td>-0.481799</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.005524</td>\n",
       "      <td>0.325958</td>\n",
       "      <td>-0.259592</td>\n",
       "      <td>0.479404</td>\n",
       "      <td>-0.074402</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Si</th>\n",
       "      <td>-0.542052</td>\n",
       "      <td>-0.069809</td>\n",
       "      <td>-0.165927</td>\n",
       "      <td>-0.005524</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.193331</td>\n",
       "      <td>-0.208732</td>\n",
       "      <td>-0.102151</td>\n",
       "      <td>-0.094201</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>K</th>\n",
       "      <td>-0.289833</td>\n",
       "      <td>-0.266087</td>\n",
       "      <td>0.005396</td>\n",
       "      <td>0.325958</td>\n",
       "      <td>-0.193331</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.317836</td>\n",
       "      <td>-0.042618</td>\n",
       "      <td>-0.007719</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Ca</th>\n",
       "      <td>0.810403</td>\n",
       "      <td>-0.275442</td>\n",
       "      <td>-0.443750</td>\n",
       "      <td>-0.259592</td>\n",
       "      <td>-0.208732</td>\n",
       "      <td>-0.317836</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.112841</td>\n",
       "      <td>0.124968</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Ba</th>\n",
       "      <td>-0.000386</td>\n",
       "      <td>0.326603</td>\n",
       "      <td>-0.492262</td>\n",
       "      <td>0.479404</td>\n",
       "      <td>-0.102151</td>\n",
       "      <td>-0.042618</td>\n",
       "      <td>-0.112841</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.058692</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Fe</th>\n",
       "      <td>0.143010</td>\n",
       "      <td>-0.241346</td>\n",
       "      <td>0.083060</td>\n",
       "      <td>-0.074402</td>\n",
       "      <td>-0.094201</td>\n",
       "      <td>-0.007719</td>\n",
       "      <td>0.124968</td>\n",
       "      <td>-0.058692</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          RI        Na        Mg        Al        Si         K        Ca  \\\n",
       "RI  1.000000 -0.191885 -0.122274 -0.407326 -0.542052 -0.289833  0.810403   \n",
       "Na -0.191885  1.000000 -0.273732  0.156794 -0.069809 -0.266087 -0.275442   \n",
       "Mg -0.122274 -0.273732  1.000000 -0.481799 -0.165927  0.005396 -0.443750   \n",
       "Al -0.407326  0.156794 -0.481799  1.000000 -0.005524  0.325958 -0.259592   \n",
       "Si -0.542052 -0.069809 -0.165927 -0.005524  1.000000 -0.193331 -0.208732   \n",
       "K  -0.289833 -0.266087  0.005396  0.325958 -0.193331  1.000000 -0.317836   \n",
       "Ca  0.810403 -0.275442 -0.443750 -0.259592 -0.208732 -0.317836  1.000000   \n",
       "Ba -0.000386  0.326603 -0.492262  0.479404 -0.102151 -0.042618 -0.112841   \n",
       "Fe  0.143010 -0.241346  0.083060 -0.074402 -0.094201 -0.007719  0.124968   \n",
       "\n",
       "          Ba        Fe  \n",
       "RI -0.000386  0.143010  \n",
       "Na  0.326603 -0.241346  \n",
       "Mg -0.492262  0.083060  \n",
       "Al  0.479404 -0.074402  \n",
       "Si -0.102151 -0.094201  \n",
       "K  -0.042618 -0.007719  \n",
       "Ca -0.112841  0.124968  \n",
       "Ba  1.000000 -0.058692  \n",
       "Fe -0.058692  1.000000  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_glass_corr = df_glass.iloc[:, 1:-1].corr()\n",
    "df_glass_corr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0IAAAHTCAYAAAAK+6i7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAAC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9UInZnk7sn2fUnO26HjroTufrC7Hxi6jmVWVZcmOae77xi6lmVSVZX1Jvz+JA8PXM7SmCzBfHWSVw1dy5L60yQv6u7nJDk9yVcNXDN6I6cAAAH3SURBVM8yeVmSjyS5Lslzquq7B65nWV2T5Iahi1gyf5zkC5J8T5I/z/rve8zn15K8ZrKc9cVJ3jlwPUzsVCP0UI4tDzlrB48Lm6qqJyR5U5JvH7qWZdPrrknywSRfN3Q9S+RVSa7v7k8NXciS+mB3/91k+3ASy6nn9+wka5NHWfx8kucPXM/Sqap9Wb9utw5cyrJ5TZLv7O7XJvmLJC8fuJ6l0d2vS/I7SV6R5K3d/dDAJTGxUw3LnTm2HO7iJHft0HHhpCb/Zf5Xk/xAd3986HqWSVV9f1W9bPL28Un8Uj+/FyW5pqpuTfKsqvrZgetZNj9XVRdX1f4k35DkA0MXtET+MskFk+0DSfzv3tZdnuQ97fkhW3VOkmdM/t5+WRLXb2ven+SpSd44dCEcsyPPEaqqz8n6TYfvTHJlkuda6rV1VXXr5AZO5lRV35XkR3PsF6kbuvtXBixpaUyGdNyU5NFJPpTkGr8YbJ2/t1tXVU9P8otJKsnbuvsHBy5paVTV2UnenPUl6KcneUl3333y72KjqvrRJIe7+9eHrmWZVNVzkrwl68vjbk/yjZKN+VXVDyX5y+7+uaFr4Zgde6Dq5JeqK5K8exLZAwAA7Ek71ggBAAAsC0MNAACAlaMRAgAAVo5GCAAAWDkaIQAAYOVohAAAgJXz/wHBs4pxANTYaQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1152x576 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure(figsize=(16, 8))\n",
    "ax = fig.add_subplot(111)\n",
    "pic = ax.pcolor(df_glass_corr, cmap=plt.cm.RdBu)\n",
    "fig.colorbar(pic, ax=ax)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "属性之间大多呈弱相关性，这是件好事。  \n",
    "但标签没有出现在热图中（因为目标值只能取几个离散值中的一个，且离散值只代表类别，大小无意义）。这无疑减少了关联热图所能展示的信息。  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
